package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.InfoUserMapper;
import com.ruoyi.system.domain.InfoUser;
import com.ruoyi.system.service.IInfoUserService;
import com.ruoyi.common.core.text.Convert;

/**
 * 坐席用户Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-30
 */
@Service
public class InfoUserServiceImpl implements IInfoUserService 
{
    @Autowired
    private InfoUserMapper infoUserMapper;

    /**
     * 查询坐席用户
     * 
     * @param userId 坐席用户主键
     * @return 坐席用户
     */
    @Override
    public InfoUser selectInfoUserByUserId(String userId)
    {
        return infoUserMapper.selectInfoUserByUserId(userId);
    }

    /**
     * 查询坐席用户列表
     * 
     * @param infoUser 坐席用户
     * @return 坐席用户
     */
    @Override
    public List<InfoUser> selectInfoUserList(InfoUser infoUser)
    {
        return infoUserMapper.selectInfoUserList(infoUser);
    }

    /**
     * 新增坐席用户
     * 
     * @param infoUser 坐席用户
     * @return 结果
     */
    @Override
    public int insertInfoUser(InfoUser infoUser)
    {
        infoUser.setCreateTime(DateUtils.getNowDate());
        return infoUserMapper.insertInfoUser(infoUser);
    }

    /**
     * 修改坐席用户
     * 
     * @param infoUser 坐席用户
     * @return 结果
     */
    @Override
    public int updateInfoUser(InfoUser infoUser)
    {
        infoUser.setUpdateTime(DateUtils.getNowDate());
        return infoUserMapper.updateInfoUser(infoUser);
    }

    /**
     * 批量删除坐席用户
     * 
     * @param userIds 需要删除的坐席用户主键
     * @return 结果
     */
    @Override
    public int deleteInfoUserByUserIds(String userIds)
    {
        return infoUserMapper.deleteInfoUserByUserIds(Convert.toStrArray(userIds));
    }

    /**
     * 删除坐席用户信息
     * 
     * @param userId 坐席用户主键
     * @return 结果
     */
    @Override
    public int deleteInfoUserByUserId(String userId)
    {
        return infoUserMapper.deleteInfoUserByUserId(userId);
    }
}
